package com.yfqy.app.domain.mapper;

import com.yfqy.app.domain.entity.IntegralRecord;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

public interface IntegralRecordMapper {

    int insert(IntegralRecord record);

    List<String> getMonthSignInRecords(@Param("userId") long userId, @Param("signInType") int signInType,
                                          @Param("now") LocalDate now, @Param("firstDayOfMonth") LocalDate firstDayOfMonth);

    Integer hasSignedToday(@Param("userId") long userId, @Param("signInType") byte signInType, @Param("today") LocalDate today);

    IntegralRecord getLatestRecord(@Param("userId") long userId, @Param("signInType") byte signInType);

    IntegralRecord selectOrderUsagePointsRecord(@Param("orderId") Long orderId, @Param("type") byte type);
}